package com.csust.travel.exception;


import com.csust.travel.common.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalException {

    @ExceptionHandler(ServiceExceptionPlus.class)
    @ResponseBody
    public Result serviceException(ServiceExceptionPlus e) {
        return Result.error(e.getCode(), e.getMessage());
    }

}
